package com.example.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserTypeEnum {

    ADMIN(1,"admin"),

    CUSTOMER(2,"customer"),

    EMPLOYEE(3,"employee");

    private final Integer roleId;

    private final String roleName;

    public static UserTypeEnum getUserType(Integer roleId) {
        for (UserTypeEnum userType : UserTypeEnum.values()) {
            if (userType.getRoleId().equals(roleId)) {
                return userType;
            }
        }
        return null;
    }
}
